var status = 0;
var ttt = "#fUI/UIWindow/Quest/icon2/7#";
var ttt2 = "#fUI/UIWindow/Quest/icon6/7#";
var ttt3 = "#fUI/UIWindow/Quest/icon3/6#";
var ttt4 = "#fUI/UIWindow/Quest/icon5/1#";
var ttt5 = "#fUI/UIWindow/Quest/icon0#";
var ttt7 = "#fUI/Basic/BtHide3/mouseOver/0#";
var ttt6 = "#fUI/UIWindow.img/PvP/Scroll/enabled/next2#";

function start() {
    status = -1;
    action(1, 0, 0)
}

function action(d, b, a) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    if (d == 1) {
        status++
    } else {
        status--
    }
    if (cm.getMapId() == 180000001) {
        cm.sendOk("很遗憾，您因为违反用户守则被禁止游戏活动，如有异议请联系管理员.");
        cm.dispose()
    } else {
        if (status == 0) {
            var c = "\r\n#e#d#L33#" + cm.getServerName() + "欢迎您。如果您对本服不了解请点这里#n#l#k\r\n";
            c += "\r\n#d======================================================#k\r\n";
            c += "#L15##r" + ttt6 + "在线奖励#l#L17#" + ttt6 + "充值奖励#l#k#b#L3#" + ttt6 + "组队任务#l#L5#" + ttt6 + "点卷中介#l\r\n\r\n";
            c += "#b#L11#" + ttt6 + "挑战首领#l#L12##r" + ttt6 + "重置副本#l#L4##b" + ttt6 + "美容美发#l#L14#" + ttt6 + "#g解密送点#l\r\n\r\n";
            c += "#b#L9#" + ttt6 + "#b娱乐副本#l#L19#" + ttt6 + "装备制作#l#b#L16#" + ttt6 + "绑定商城#b#L21#" + ttt6 + "绝版点装#l\r\n\r\n";
            c += "#L30##r" + ttt6 + "抵用奖励#l#L31#" + ttt6 + "男神女神#l#L34#" + ttt6 + "寄售系统#l#L35#" + ttt6 + "洗血HP#l\r\n\r\n";
            c += "#L36##r" + ttt6 + "OX问答#l  #L37##r" + ttt6 + "上乘装备#l#L38##r" + ttt6 + "理财系统#l#L39##r" + ttt6 + "装备换购#l\r\n";
            c += "\r\n#d======================================================#k\r\n";
            cm.sendSimple(c)
        } else {
            if (status == 1) {
                switch (a) {
                    case 0:
                        cm.dispose();
                        cm.openNpc(9310144, 1);
                        break;
                    case 1:
                        cm.dispose();
                        cm.openNpc(9310144, 9);
                        break;
                    case 8:
                        cm.dispose();
                        cm.openNpc(9310144, 3);
                        break;
                    case 4:
                        cm.dispose();
                        cm.openNpc(9900003, 1111);
                        break;
                    case 2:
                        cm.dispose();
                        cm.openNpc(9900003, 15);
                        break;
                    case 5:
                        cm.dispose();
                        cm.openNpc(9310144, 4);
                        break;
                    case 3:
                        cm.dispose();
                        cm.openNpc(9310144, 6);
                        break;
                    case 6:
                        cm.dispose();
                        cm.openNpc(9020000);
                        break;
                    case 7:
                        cm.dispose();
                        cm.openNpc(2040034);
                        break;
                    case 10:
                        cm.dispose();
                        cm.openNpc(9900003, 10);
                        break;
                    case 9:
                        cm.dispose();
                        cm.openNpc(9900003, 108);
                        break;
                    case 11:
                        cm.dispose();
                        cm.openNpc(9900003, 13);
                        break;
                    case 12:
                        cm.dispose();
                        cm.openNpc(9900004, 3);
                        break;
                    case 13:
                        cm.dispose();
                        cm.openNpc(9900003, 110);
                        break;
                    case 14:
                        cm.dispose();
                        cm.openNpc(9900003, 111);
                        break;
                    case 15:
                        cm.dispose();
                        cm.openNpc(9900003, 608);
                        break;
                    case 16:
                        cm.dispose();
                        cm.openNpc(9310144, 3);
                        break;
                    case 17:
                        cm.dispose();
                        cm.openNpc(9310144, 8);
                        break;
                    case 18:
                        cm.sendOk("近期开放");
                        cm.dispose();
                        break;
                    case 19:
                        cm.dispose();
                        cm.openNpc(9900003, 24);
                        break;
                    case 20:
                        cm.dispose();
                        cm.openNpc(9310144, 3);
                        break;
                    case 21:
                        cm.dispose();
                        cm.openNpc(9900003, 10);
                        break;
                    case 22:
                        cm.dispose();
                        cm.openNpc(9201290, 0);
                        break;
                    case 30:
                        cm.dispose();
                        cm.openNpc(9000345, 0);
                        break;
                    case 31:
                        cm.dispose();
                        cm.openNpc(9001014, 0);
                        break;
                    case 33:
                        cm.dispose();
                        cm.openNpc(9330006);
                        break;
                    case 34:
                        cm.dispose();
                        cm.openNpc(9310144, 1000);
                        break;
                    case 35:
                        cm.dispose();
                        cm.openNpc(9300011, 1);
                        break;
                    case 36:
                        cm.dispose();
                        cm.openNpc(9000277);
                        break;
                    case 37:
                        cm.dispose();
                        cm.openNpc(9900003, 1008);
                        break;
                    case 38:
                        cm.dispose();
                        cm.openNpc(9310144, 17);
                        break;
                    case 39:
                        cm.dispose();
                        cm.openNpc(9310071, 1);
                        break
                }
            }
        }
    }
};